from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
from typing import Optional
from module_admin.annotation.pydantic_annotation import as_query




class BasicModel(BaseModel):
    """
    股票基础信息表对应pydantic模型
    """
    model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)

    symbol: Optional[str] = Field(default=None, description='')
    name: Optional[str] = Field(default=None, description='')






class BasicQueryModel(BasicModel):
    """
    股票基础信息不分页查询模型
    """
    pass


@as_query
class BasicPageQueryModel(BasicQueryModel):
    """
    股票基础信息分页查询模型
    """

    page_num: int = Field(default=1, description='当前页码')
    page_size: int = Field(default=10, description='每页记录数')


class DeleteBasicModel(BaseModel):
    """
    删除股票基础信息模型
    """

    model_config = ConfigDict(alias_generator=to_camel)

    symbols: str = Field(description='需要删除的')
